package service

import (
	"gameserver/gcommon"
	"gameserver/server/Game/internal"

	"gitee.com/night-tc/gobige/service"
)

var _ internal.IService = &GameService{}

/*
GameService的服务接口
*/
type GameService struct {
	*service.Service
	//服务器信息
	Sinfo *gcommon.ServiceConfig
}

func NewService(sinfo *gcommon.ServiceConfig) (result *GameService) {
	result = &GameService{}
	result.Sinfo = sinfo
	result.Service = service.NewService(sinfo.GlobalConfig, result)
	return
}

func (this *GameService) Init() (err error) {
	this.RegMsgProc(&Service_Proc{this})
	if err = this.Service.Init(); err != nil {
		return err
	}
	return nil
}
